﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Program05._1
{
    public class Student
    {
        //学号
        public string NO { get; set; }
        //姓名
        public string Name { get; set; }
        //年龄
        private int age { get; set; }

        public int Age
        {
            get => age;
            set => age = value > 150 || value < 0 ? 0 : value;
        }
        public override string ToString() => $"学号:{NO},姓名:{Name},年龄:{Age}";
     
    }
}
